In [1]:
%matplotlib inline

import itertools
import matplotlib
import matplotlib.pyplot
import numpy
import os
import pandas
import scipy.misc
import scipy.special
import scipy.stats
import seaborn

In [2]:
# colormap for data visualizations
cmap = seaborn.cubehelix_palette(n_colors = 20, start = 0.8, rot = 0.75,
                                gamma = 0.3, hue = 2.0, dark = 0.005,
                                light = 0.95, reverse = True, as_cmap = True)

How many different combinations of advisors and retired advisor stickers exist? Is it as straightforward as enumerating the combinations between the number of empty advisor slots and retired advisor stickers? Though this creates an upper limit, does the order of the retired advisor stickers prevent some combinations from happening? The number of players will effect the distribution of stickers at the end of the game. The timing of boxes openning will bias the addition of stickers to earlier advisors. Therefore, in addition to the possible combinations, what is the distribution of retired advisor stickers? I think this last question is best answered through simulation.

Enumerating the upper limit of adivsor combinations.

A natural starting point would be calculating the number of unique combinations between the advisor deck and the retired advisors.


In [4]:
df_advisors = pandas.read_excel("advisors.xlsx")
df_retired = pandas.read_excel("retired_advisors.xlsx")

In [10]:
sum_empty_slots = numpy.sum(df_advisors["empty_slots"])
sum_retired_stickers = len(df_retired)*3 # There are 3 stickers on each retired advisor
print("The number of empty slots in the advisor deck is", sum_empty_slots)
print("The number of retired advisor stickers is", sum_retired_stickers)


The number of empty slots in the advisor deck is 63
The number of retired advisor stickers is 42

In [15]:
number_unique_advisor_decks = scipy.special.comb(sum_empty_slots, sum_retired_stickers)
print("The unique number of decks is", number_unique_advisor_decks)


The unique number of decks is 2.7619435402363024e+16

There are 63 empty slots across all of the advisors and 42 retired advisor stickers. The number of unique advisor decks that can exist after all retired advisor stickers have been placed onto empty slots is almost 30 quadrillion! However, this is an overestimate of the actual number of unique decks since there are duplicates of most of the retired advisors across the 4 guilds.

https://math.stackexchange.com/questions/1902850/efficient-algorithm-to-find-all-unique-combinations-of-set-given-duplicates http://mathforum.org/library/drmath/view/56197.html https://math.stackexchange.com/questions/2131/permutations-with-duplicates https://math.stackexchange.com/questions/114654/permutations-of-subsets-of-a-multiset/ https://mathoverflow.net/questions/33273/combinations-of-multisets-with-finite-multiplicities

We'll have to calculate the combination of a mutliset to derive the account for duplicated stickers.

To help with the math we'll pretend we have 21 null stickers to add to the 42 retired advisor stickers to match the number of empty slots on the advisor cards. Now the problem becomes counting the u


In [16]:



Out[16]:
name buy_goods sell_goods tax raid explore research upgrade build set stage
0 Retired Adventurer 0 0 0 0 1 0 0 0 starter 1
1 Retired Adventurer 0 0 0 0 1 0 0 0 starter 1
2 Retired Pirate 0 0 0 1 0 0 0 0 starter 1
3 Retired Taxman 0 0 1 0 0 0 0 0 starter 1
4 Retired Recruiter 0 0 0 0 0 0 1 0 starter 1
5 Retired Builder 0 0 0 0 0 0 0 1 starter 1
6 Retired Merchant 1 0 0 0 0 0 0 0 starter 1
7 Retired Trader 0 1 0 0 0 0 0 0 starter 1
8 Retired Scoundrel 0 0 0 1 0 0 0 0 rough seas 2
9 Retired Librarian 0 0 0 0 0 1 0 0 rough seas 2
10 Retired Captain 0 0 0 0 1 0 0 0 rough seas 2
11 Retired Builder 0 0 0 0 0 0 0 1 cities 4
12 Retired Trader 0 1 0 0 0 0 0 0 cities 4
13 Retired Merchant 1 0 0 0 0 0 0 0 cities 4

In [1]:
63-42


Out[1]:
21

In [ ]: